home *** CD-ROM | disk | FTP | other *** search
/ Info-Mac 3 / Info_Mac_1994-01.iso / Development / Source / Sleep Deprivation 1.0 Source / Sleep Deprivation ƒ / sd wipes ƒ / Full scroll U-D.c < prev    next >
Encoding:
C/C++ Source or Header  |  1993-11-12  |  2.2 KB  |  67 lines  |  [TEXT/KAHL]

  1. /**********************************************************************\
  2.  
  3. File:        Full scroll U-D.c
  4.  
  5. Purpose:    This module handles clearing the screen in a funky
  6.             manner.  See the comments below for more details.
  7.             
  8.  
  9. Sleep Deprivation -- graphic effects on sleep
  10. Copyright (C) 1993 Mark Pilgrim & Dave Blumenthal
  11.  
  12. This program is free software; you can redistribute it and/or modify
  13. it under the terms of the GNU General Public License as published by
  14. the Free Software Foundation; either version 2 of the License, or
  15. (at your option) any later version.
  16.  
  17. This program is distributed in the hope that it will be useful,
  18. but WITHOUT ANY WARRANTY; without even the implied warranty of
  19. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  20. GNU General Public License for more details.
  21.  
  22. You should have received a copy of the GNU General Public License
  23. along with this program in a file named "GNU General Public License".
  24. If not, write to the Free Software Foundation, 675 Mass Ave,
  25. Cambridge, MA 02139, USA.
  26.  
  27. \**********************************************************************/
  28.  
  29. #include "msg timing.h"
  30.  
  31. #define        BoxSize        10
  32. #define CorrectTime 3
  33.  
  34. void FullScrollUD(GrafPtr, Pattern*);
  35.  
  36. /* Take the full screen minus the bottom strip, move it into the whole screen
  37.    shifted down by BoxSize, then take the bottommost source strip and put it
  38.    in the top strip of the dest. window. */
  39.    
  40. void FullScrollUD(GrafPtr thePtr, Pattern *thePattern)
  41. {
  42.     int            x, y;
  43.     Rect        theRect, dest;
  44.     Rect        scrollsource, scrolldest;
  45.     int            width,height;
  46.     
  47.     width=thePtr->portRect.right-thePtr->portRect.left;
  48.     height=thePtr->portRect.bottom-thePtr->portRect.top;
  49.         
  50.     scrollsource=thePtr->portRect;
  51.     scrollsource.bottom-=BoxSize;              /* whole screen minus bottom strip */
  52.     scrolldest = scrollsource;
  53.     OffsetRect(&scrolldest, 0, BoxSize);       /* whole screen shifted down BoxSize */
  54.     
  55.     dest = thePtr->portRect;
  56.     dest.bottom=BoxSize;                       /* top strip for new data */
  57.     
  58.     for(x = height - BoxSize; x >= 0; x -= BoxSize)
  59.     {
  60.         StartTiming();
  61.         CopyBits(&(thePtr->portBits), &(thePtr->portBits),
  62.                 &scrollsource, &scrolldest, 0, 0L);
  63.         FillRect(&dest, *thePattern);
  64.         
  65.         TimeCorrection(CorrectTime);
  66.     }
  67. }